.class public Lrexsee/multimedia/RexseeAudioPlayer;
.super Ljava/lang/Object;
.source "RexseeAudioPlayer.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final DEFAULT_ID:Ljava/lang/String; = "default"

.field public static final EVENT_ONAUDIOBUFFERINGUPDATED:Ljava/lang/String; = "onAudioBufferingUpdated"

.field public static final EVENT_ONAUDIOPLAYCOMPLETED:Ljava/lang/String; = "onAudioPlayCompleted"

.field public static final EVENT_ONAUDIOPLAYERINFO:Ljava/lang/String; = "onAudioPlayerInfo"

.field public static final EVENT_ONAUDIOSEEKCOMPLETED:Ljava/lang/String; = "onAudioSeekCompleted"

.field private static final INTERFACE_NAME:Ljava/lang/String; = "AudioPlayer"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;

.field private final mMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Landroid/media/MediaPlayer;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 44
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 45
    iput-object p1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    .line 46
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mContext:Landroid/content/Context;

    .line 47
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    .line 48
    iget-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onAudioBufferingUpdated"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 49
    iget-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onAudioPlayCompleted"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 50
    iget-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onAudioPlayerInfo"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 51
    iget-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onAudioSeekCompleted"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 52
    iget-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->destroyListeners:Lrexsee/core/browser/clazz/DestroyListeners;

    new-instance v1, Lrexsee/multimedia/RexseeAudioPlayer$1;

    invoke-direct {v1, p0}, Lrexsee/multimedia/RexseeAudioPlayer$1;-><init>(Lrexsee/multimedia/RexseeAudioPlayer;)V

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/DestroyListeners;->add(Ljava/lang/Runnable;)V

    .line 58
    return-void
.end method

.method static synthetic access$0(Lrexsee/multimedia/RexseeAudioPlayer;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 40
    iget-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method


# virtual methods
.method public getCurrentPosition()I
    .locals 1

    .prologue
    .line 274
    const-string v0, "default"

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeAudioPlayer;->getCurrentPosition(Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public getCurrentPosition(Ljava/lang/String;)I
    .locals 5
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    const/4 v4, -0x1

    .line 277
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/MediaPlayer;

    .line 278
    .local v1, "player":Landroid/media/MediaPlayer;
    if-nez v1, :cond_0

    move v2, v4

    .line 283
    :goto_0
    return v2

    .line 280
    :cond_0
    :try_start_0
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->getCurrentPosition()I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v2

    goto :goto_0

    .line 281
    :catch_0
    move-exception v0

    .line 282
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move v2, v4

    .line 283
    goto :goto_0
.end method

.method public getDuration()I
    .locals 1

    .prologue
    .line 261
    const-string v0, "default"

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeAudioPlayer;->getDuration(Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public getDuration(Ljava/lang/String;)I
    .locals 5
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    const/4 v4, -0x1

    .line 264
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/MediaPlayer;

    .line 265
    .local v1, "player":Landroid/media/MediaPlayer;
    if-nez v1, :cond_0

    move v2, v4

    .line 270
    :goto_0
    return v2

    .line 267
    :cond_0
    :try_start_0
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->getDuration()I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v2

    goto :goto_0

    .line 268
    :catch_0
    move-exception v0

    .line 269
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move v2, v4

    .line 270
    goto :goto_0
.end method

.method public getIds()Ljava/lang/String;
    .locals 6

    .prologue
    const-string v5, "\""

    .line 65
    const-string v2, ""

    .line 66
    .local v2, "rtn":Ljava/lang/String;
    iget-object v3, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v0

    .line 67
    .local v0, "ids":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 68
    .end local p0    # "this":Lrexsee/multimedia/RexseeAudioPlayer;
    .local v1, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/lang/String;>;"
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_0

    .line 72
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "["

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "]"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    return-object v3

    .line 69
    :cond_0
    const-string v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, ","

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 70
    :cond_1
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, "\""

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Ljava/lang/String;

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "\""

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    goto :goto_0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 26
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 22
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "AudioPlayer"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 30
    new-instance v0, Lrexsee/multimedia/RexseeAudioPlayer;

    invoke-direct {v0, p1}, Lrexsee/multimedia/RexseeAudioPlayer;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public isLooping()Z
    .locals 1

    .prologue
    .line 287
    const-string v0, "default"

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeAudioPlayer;->isLooping(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public isLooping(Ljava/lang/String;)Z
    .locals 2
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 290
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/media/MediaPlayer;

    .line 291
    .local v0, "player":Landroid/media/MediaPlayer;
    if-nez v0, :cond_0

    const/4 v1, 0x0

    .line 292
    :goto_0
    return v1

    :cond_0
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isLooping()Z

    move-result v1

    goto :goto_0
.end method

.method public isPlaying()Z
    .locals 1

    .prologue
    .line 295
    const-string v0, "default"

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeAudioPlayer;->isPlaying(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public isPlaying(Ljava/lang/String;)Z
    .locals 2
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 298
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/media/MediaPlayer;

    .line 299
    .local v0, "player":Landroid/media/MediaPlayer;
    if-nez v0, :cond_0

    const/4 v1, 0x0

    .line 300
    :goto_0
    return v1

    :cond_0
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v1

    goto :goto_0
.end method

.method public pause()V
    .locals 1

    .prologue
    .line 225
    const-string v0, "default"

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeAudioPlayer;->pause(Ljava/lang/String;)V

    .line 226
    return-void
.end method

.method public pause(Ljava/lang/String;)V
    .locals 4
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 228
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/MediaPlayer;

    .line 229
    .local v1, "player":Landroid/media/MediaPlayer;
    if-nez v1, :cond_0

    .line 235
    :goto_0
    return-void

    .line 231
    :cond_0
    :try_start_0
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->pause()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 232
    :catch_0
    move-exception v0

    .line 233
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public resume()V
    .locals 1

    .prologue
    .line 237
    const-string v0, "default"

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeAudioPlayer;->resume(Ljava/lang/String;)V

    .line 238
    return-void
.end method

.method public resume(Ljava/lang/String;)V
    .locals 4
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 240
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/MediaPlayer;

    .line 241
    .local v1, "player":Landroid/media/MediaPlayer;
    if-nez v1, :cond_0

    .line 247
    :goto_0
    return-void

    .line 243
    :cond_0
    :try_start_0
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->start()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 244
    :catch_0
    move-exception v0

    .line 245
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public seekTo(I)V
    .locals 1
    .param p1, "milliseconds"    # I

    .prologue
    .line 249
    const-string v0, "default"

    invoke-virtual {p0, v0, p1}, Lrexsee/multimedia/RexseeAudioPlayer;->seekTo(Ljava/lang/String;I)V

    .line 250
    return-void
.end method

.method public seekTo(Ljava/lang/String;I)V
    .locals 4
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "milliseconds"    # I

    .prologue
    .line 252
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/MediaPlayer;

    .line 253
    .local v1, "player":Landroid/media/MediaPlayer;
    if-nez v1, :cond_0

    .line 259
    :goto_0
    return-void

    .line 255
    :cond_0
    :try_start_0
    invoke-virtual {v1, p2}, Landroid/media/MediaPlayer;->seekTo(I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 256
    :catch_0
    move-exception v0

    .line 257
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public setVolume(F)Z
    .locals 5
    .param p1, "volume"    # F

    .prologue
    const/4 v3, 0x3

    const/4 v4, 0x0

    .line 304
    const/4 v1, 0x0

    cmpg-float v1, p1, v1

    if-ltz v1, :cond_0

    const/high16 v1, 0x3f800000    # 1.0f

    cmpl-float v1, p1, v1

    if-lez v1, :cond_1

    .line 305
    :cond_0
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "The volumn must between 0 and 1."

    invoke-virtual {v1, v2, v3}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v1, v4

    .line 310
    :goto_0
    return v1

    .line 308
    :cond_1
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mContext:Landroid/content/Context;

    const-string v2, "audio"

    invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/media/AudioManager;

    .line 309
    .local v0, "mAudioManager":Landroid/media/AudioManager;
    invoke-virtual {v0, v3}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I

    move-result v1

    int-to-float v1, v1

    mul-float/2addr v1, p1

    invoke-static {v1}, Ljava/lang/Math;->round(F)I

    move-result v1

    invoke-virtual {v0, v3, v1, v4}, Landroid/media/AudioManager;->setStreamVolume(III)V

    .line 310
    const/4 v1, 0x1

    goto :goto_0
.end method

.method public size()I
    .locals 1

    .prologue
    .line 62
    iget-object v0, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->size()I

    move-result v0

    return v0
.end method

.method public start(Ljava/lang/String;Ljava/lang/String;Z)Z
    .locals 11
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "url"    # Ljava/lang/String;
    .param p3, "looping"    # Z

    .prologue
    const/4 v10, 0x1

    const/4 v9, 0x0

    const-string v1, "file:///android_asset/"

    .line 79
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->urlListeners:Lrexsee/core/browser/RexseeUrl;

    invoke-virtual {v1, p2}, Lrexsee/core/browser/RexseeUrl;->getAbsoluteUrl(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p2

    .line 80
    invoke-virtual {p0, p1}, Lrexsee/multimedia/RexseeAudioPlayer;->stop(Ljava/lang/String;)V

    .line 82
    :try_start_0
    new-instance v0, Landroid/media/MediaPlayer;

    invoke-direct {v0}, Landroid/media/MediaPlayer;-><init>()V

    .line 83
    .local v0, "player":Landroid/media/MediaPlayer;
    invoke-virtual {v0, p3}, Landroid/media/MediaPlayer;->setLooping(Z)V

    .line 84
    const/4 v1, 0x3

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setAudioStreamType(I)V

    .line 85
    new-instance v1, Lrexsee/multimedia/RexseeAudioPlayer$2;

    invoke-direct {v1, p0, p1}, Lrexsee/multimedia/RexseeAudioPlayer$2;-><init>(Lrexsee/multimedia/RexseeAudioPlayer;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnBufferingUpdateListener(Landroid/media/MediaPlayer$OnBufferingUpdateListener;)V

    .line 91
    new-instance v1, Lrexsee/multimedia/RexseeAudioPlayer$3;

    invoke-direct {v1, p0, p1}, Lrexsee/multimedia/RexseeAudioPlayer$3;-><init>(Lrexsee/multimedia/RexseeAudioPlayer;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    .line 98
    new-instance v1, Lrexsee/multimedia/RexseeAudioPlayer$4;

    invoke-direct {v1, p0, p1}, Lrexsee/multimedia/RexseeAudioPlayer$4;-><init>(Lrexsee/multimedia/RexseeAudioPlayer;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnSeekCompleteListener(Landroid/media/MediaPlayer$OnSeekCompleteListener;)V

    .line 104
    new-instance v1, Lrexsee/multimedia/RexseeAudioPlayer$5;

    invoke-direct {v1, p0}, Lrexsee/multimedia/RexseeAudioPlayer$5;-><init>(Lrexsee/multimedia/RexseeAudioPlayer;)V

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnErrorListener(Landroid/media/MediaPlayer$OnErrorListener;)V

    .line 126
    new-instance v1, Lrexsee/multimedia/RexseeAudioPlayer$6;

    invoke-direct {v1, p0, p1}, Lrexsee/multimedia/RexseeAudioPlayer$6;-><init>(Lrexsee/multimedia/RexseeAudioPlayer;Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnInfoListener(Landroid/media/MediaPlayer$OnInfoListener;)V

    .line 154
    new-instance v1, Lrexsee/multimedia/RexseeAudioPlayer$7;

    invoke-direct {v1, p0}, Lrexsee/multimedia/RexseeAudioPlayer$7;-><init>(Lrexsee/multimedia/RexseeAudioPlayer;)V

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnPreparedListener(Landroid/media/MediaPlayer$OnPreparedListener;)V

    .line 160
    invoke-virtual {p2}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v8

    .line 161
    .local v8, "lUrl":Ljava/lang/String;
    const-string v1, "file:///android_asset/"

    invoke-virtual {v8, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 162
    const-string v1, "file:///android_asset/"

    const-string v2, ""

    invoke-virtual {p2, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object p2

    .line 163
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/res/Resources;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v1

    invoke-virtual {v1, p2}, Landroid/content/res/AssetManager;->openFd(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;

    move-result-object v7

    .line 164
    .local v7, "file":Landroid/content/res/AssetFileDescriptor;
    invoke-virtual {v7}, Landroid/content/res/AssetFileDescriptor;->getFileDescriptor()Ljava/io/FileDescriptor;

    move-result-object v1

    invoke-virtual {v7}, Landroid/content/res/AssetFileDescriptor;->getStartOffset()J

    move-result-wide v2

    invoke-virtual {v7}, Landroid/content/res/AssetFileDescriptor;->getLength()J

    move-result-wide v4

    invoke-virtual/range {v0 .. v5}, Landroid/media/MediaPlayer;->setDataSource(Ljava/io/FileDescriptor;JJ)V

    .line 165
    invoke-virtual {v7}, Landroid/content/res/AssetFileDescriptor;->close()V

    .line 166
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->prepareAsync()V

    .line 167
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move v1, v10

    .line 191
    .end local v0    # "player":Landroid/media/MediaPlayer;
    .end local v7    # "file":Landroid/content/res/AssetFileDescriptor;
    .end local v8    # "lUrl":Ljava/lang/String;
    :goto_0
    return v1

    .line 169
    .restart local v0    # "player":Landroid/media/MediaPlayer;
    .restart local v8    # "lUrl":Ljava/lang/String;
    :cond_0
    const-string v1, "file://"

    invoke-virtual {v8, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 170
    invoke-static {p2}, Lrexsee/core/utilities/Utilities;->prepareReadFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v7

    .line 171
    .local v7, "file":Ljava/io/File;
    if-nez v7, :cond_1

    .line 172
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "The audio file doesn\'t exist."

    invoke-virtual {v1, v2, v3}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v1, v9

    .line 173
    goto :goto_0

    .line 175
    :cond_1
    invoke-virtual {v7}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object p2

    .line 176
    invoke-virtual {v0, p2}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    .line 177
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->prepareAsync()V

    .line 178
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move v1, v10

    .line 179
    goto :goto_0

    .line 180
    .end local v7    # "file":Ljava/io/File;
    :cond_2
    const-string v1, "http://"

    invoke-virtual {v8, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_3

    const-string v1, "https://"

    invoke-virtual {v8, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_3

    const-string v1, "rtsp://"

    invoke-virtual {v8, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_4

    .line 181
    :cond_3
    invoke-virtual {v0, p2}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    .line 182
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->prepareAsync()V

    .line 183
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move v1, v10

    .line 184
    goto :goto_0

    .line 186
    :cond_4
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    const-string v3, "Invalid file path."

    invoke-virtual {v1, v2, v3}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move v1, v9

    .line 187
    goto :goto_0

    .line 189
    .end local v0    # "player":Landroid/media/MediaPlayer;
    .end local v8    # "lUrl":Ljava/lang/String;
    :catch_0
    move-exception v1

    move-object v6, v1

    .line 190
    .local v6, "e":Ljava/lang/Exception;
    iget-object v1, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2, v6}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move v1, v9

    .line 191
    goto :goto_0
.end method

.method public start(Ljava/lang/String;Z)Z
    .locals 1
    .param p1, "url"    # Ljava/lang/String;
    .param p2, "looping"    # Z

    .prologue
    .line 76
    const-string v0, "default"

    invoke-virtual {p0, v0, p1, p2}, Lrexsee/multimedia/RexseeAudioPlayer;->start(Ljava/lang/String;Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method

.method public stop()V
    .locals 1

    .prologue
    .line 195
    const-string v0, "default"

    invoke-virtual {p0, v0}, Lrexsee/multimedia/RexseeAudioPlayer;->stop(Ljava/lang/String;)V

    .line 196
    return-void
.end method

.method public stop(Ljava/lang/String;)V
    .locals 4
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 198
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/media/MediaPlayer;

    .line 199
    .local v1, "player":Landroid/media/MediaPlayer;
    if-nez v1, :cond_0

    .line 208
    :goto_0
    return-void

    .line 201
    :cond_0
    :try_start_0
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->stop()V

    .line 202
    invoke-virtual {v1}, Landroid/media/MediaPlayer;->release()V

    .line 203
    const/4 v1, 0x0

    .line 204
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 205
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 206
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeAudioPlayer;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public stopAll()V
    .locals 5

    .prologue
    .line 210
    iget-object v3, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v0

    .line 211
    .local v0, "ids":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 212
    .local v1, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/lang/String;>;"
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_0

    .line 221
    iget-object v3, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->clear()V

    .line 222
    return-void

    .line 213
    :cond_0
    iget-object v3, p0, Lrexsee/multimedia/RexseeAudioPlayer;->mMap:Ljava/util/HashMap;

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/media/MediaPlayer;

    .line 215
    .local v2, "player":Landroid/media/MediaPlayer;
    :try_start_0
    invoke-virtual {v2}, Landroid/media/MediaPlayer;->stop()V

    .line 216
    invoke-virtual {v2}, Landroid/media/MediaPlayer;->release()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 217
    const/4 v2, 0x0

    goto :goto_0

    .line 218
    :catch_0
    move-exception v3

    goto :goto_0
.end method
